// JavaScript Document

// This function enables/disables an element, if another element (usually a form checkbox) is checked/unchecked.
//
// Parameter list:
// id 			= ID of the element to be enabled/disabled
// condition 	= ID of the element that has to be checked/unchecked

/*
	Copyright 2011 Tobias Heinzer + Peter Affentranger

	This file is part of the website flugservice.ch.

    The website flugservice.ch is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    The website flugservice.ch is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with the website flugservice.ch.  If not, see <http://www.gnu.org/licenses/>.
*/

function enableElement(id, condition) {
	if (document.getElementById(condition).checked) {document.getElementById(id).disabled = false}
	if (!document.getElementById(condition).checked){document.getElementById(id).disabled = true}
}
